package cn.tedu.mvc.web.filter;

import javax.servlet.*;
import java.io.IOException;

public class DataFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("Filter.init()");
    }
    /**此方法用于实现数据过滤的方法*/
    @Override
    public void doFilter(ServletRequest request,
                         ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("==doFilter()===");
        //继续执行后续过滤链
        filterChain.doFilter(request, response);
    }
    @Override
    public void destroy() {
        System.out.println("Filter.destroy()");
    }
}
